<?php
	class Image extends Element{
		private $src = "";
		private $title = "";
		private $width = "";
		private $height = "";
		
		public function __construct($src, $class, $width, $height){
			$this->src = $src;
			$this->class = $class;
			$this->width = $width;
			$this->height = $height;
		}
		
		public function getCode(){
			$this->code = "<img src='".$this->src."' class='".$this->class."'";
			if($this->title != ""){
				$this->code = $this->code." title='".$this->title."'";
			}
			if($this->width != ""){
				$this->code = $this->code." width='".$this->width."'";
			}
			if($this->height != ""){
				$this->code = $this->code." height='".$this->height."'";
			}
			$this->code = $this->code."/>";
			
			return $this->code;
		}
		
		public function setClass($class){
			$this->class = $class;
		}
		
		public function setSource($src){
			$this->src = $src;
		}
		
		public function setTitle($title){
			$this->title = $title;
		}
		
		public function setSize($width, $height){
			$this->width = $width;
			$this->height = $height;
		}
		
		public function getClass(){
			return $this->class;
		}
		
		public function getSource(){
			return $this->src;
		}
		
		public function getTitle(){
			return $this->title;
		}
		
		public function getSize(){
			$size = array("width"=>$this->width, "height"=>$this->height);
			return $size;
		}
	}
?>